package mian;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Scanner;

/**
 * @auther wangchenghao
 * @date 2021/6/1
 *
 * 寻找最高频率字符串
 **/
public class test1 {
    public static String findMostFrequentArray(String array){
        char[] arrays=array.toCharArray();
        String result="";
        int size=array.length();
        if(size==0){
            return "";
        }
        Map<String,Integer> m =new HashMap<String,Integer>();
        for(int i=0;i<size;i++){
            if(m.containsKey(arrays[i])){
                m.put(String.valueOf(arrays[i]),m.get(arrays[i]+1));
            }else{
                m.put(String.valueOf(arrays[i]),1);
            }
        }

        int most=0;
        Iterator iter=m.entrySet().iterator();
        while(iter.hasNext()){
            Map.Entry entry=(Map.Entry)iter.next();
            String key=(String)entry.getKey();
            int val=(Integer)entry.getValue();
            if(val>most) {
                result = key;
                most = val;
            }
        }
        return result;
    }

    public static void main(String[] args){
        Scanner data = new Scanner(System.in);
        String test=data.next();
        String mostFrequentArray = findMostFrequentArray(test);
        System.out.println(mostFrequentArray);
    }
}
